from flask import Flask


from common.models import db
from flask_restful import Api,Resource
from .resources.stu import stubp
from .resources.work import workbp

def create_flask_app(config):
    app = Flask(__name__)
    app.config.from_object(config)
    db.init_app(app)

    # 绑定蓝图...
    app.register_blueprint(stubp)
    app.register_blueprint(workbp)
    # 创建api...
    api = Api(app)
    return app


